<template>
  <el-pagination
    :current-page.sync="params.pageNum"
    :page-sizes="params.pageSizes"
    :page-size="params.pageSize"
    layout="total, sizes, prev, pager, next, jumper"
    :total="params.total"
    background
    @size-change="params.sizeChange"
    @current-change="params.currentChange"
  />
</template>

<script>
export default {
  name: 'Pagenation',
  props: {
    params: {
      type: Object,
      default: () => {
        return {
          pageNum: 1,
          pageSize: 10,
          pageSizes: [10, 20, 30, 50],
          total: 0,
          sizeChange: () => {},
          currentChange: () => {}
        }
      }
    }
  },
  data() {
    return {
    }
  },
  created() {
    // console.log('pagenation')
  },
  mounted() {
  },
  methods: {
    handleSizeChange(pageSize) {
      this.params.pageSize = pageSize
    },
    handleCurrentChange(pageNum) {
      this.params.pageNum = pageNum
    }
  }
}
</script>

<style>

</style>
